<?php
header("Content-type: text/html; charset=utf-8");

require_once 'admin/class/User.class.php';
require_once 'admin/class/Info.class.php';
require_once 'admin/class/Integral.class.php';
require_once 'admin/class/Power.class.php';
require_once 'admin/class/Record.class.php';
require_once 'admin/Manager/userManager.class.php';

$user = new User();
$user->setBlockId("5555");
$user->setName("jimmy");
$user->setPassword("88888");
$user->setStatues(1);

$info = new Info();
$info->setAddr("here");
$info->setBirthday("2012-12-12");
$info->setCreateTime("2012-12-30 12:12:12:00");
$info->setEmail("12345678@qq.com");
$info->setIDCard("44444554545");
$info->setPhone("123456789");
$info->setSex(1);

$user->setInfo($info);

//var_dump($user);
//echo $user->getInfo()->getEmail();
$userManager = new userManager();
/*
 * 添加用户
 */
//echo $userManager->addUser($user);

$info2 = new Info();
$info2->setAddr("z中文");
$info2->setBirthday("2012-12-12");
$info2->setCreateTime("2012-12-30 12:12:12:00");
$info2->setEmail("3242348@qq.com");
$info2->setPhone("9857");
$info2->setSex(1);


$user2 = new User();
$user2->setID(3);
$user2->setInfo($info2);

/*
 * 更新用户
 */
//echo $userManager->updateUser($user2);

/*
 * 删除用户
 */
$user3 = new User();
$user3->setID(6);
//echo $userManager->deleteUser($user3);


/*
 * 更新密码
 */
$user4 = new User();
$user4->setID(1);
$user4->setPassword("01010101");
//echo $userManager->updatePassword($user4);
/*
 * 更新用户状态
 */
//echo $userManager->updateStatuts(1, 2);

/*
 * 查询功能
 */
//print_r($userManager->findUserByCardid(3333));

/*
 * 查询功能
 */
print_r($userManager->findAllUser());
?>